
malloc3.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <main>:
#include <stdlib.h>

#define ONE_K (1024)

int main()
{
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
   8:	e24dd010 	sub	sp, sp, #16
  char * some_memory;
  int size_to_allocate = ONE_K;
   c:	e3a03b01 	mov	r3, #1024	; 0x400
  10:	e50b3010 	str	r3, [fp, #-16] ; size_to_allocate
  int megs_obtained = 0;
  14:	e3a03000 	mov	r3, #0
  18:	e50b3008 	str	r3, [fp, #-8] ; megs_obtained
  int ks_obtained = 0;
  1c:	e3a03000 	mov	r3, #0
  20:	e50b300c 	str	r3, [fp, #-12] ; ks_obtained

  while (1) {
    for (ks_obtained = 0; ks_obtained < 1024; ks_obtained++) {
  24:	e3a03000 	mov	r3, #0
  28:	e50b300c 	str	r3, [fp, #-12]
  2c:	ea000013 	b	80 <main+0x80>
      some_memory = (char *)malloc(size_to_allocate);
  30:	e51b3010 	ldr	r3, [fp, #-16]
  34:	e1a00003 	mov	r0, r3
  38:	ebfffffe 	bl	0 <malloc>
  3c:	e1a03000 	mov	r3, r0
  40:	e50b3014 	str	r3, [fp, #-20]	; 0xffffffec  some_memory
      if (some_memory == NULL)
  44:	e51b3014 	ldr	r3, [fp, #-20]	; 0xffffffec
  48:	e3530000 	cmp	r3, #0
  4c:	1a000001 	bne	58 <main+0x58>
	exit(EXIT_FAILURE);
  50:	e3a00001 	mov	r0, #1
  54:	ebfffffe 	bl	0 <exit>
      sprintf(some_memory, "hello world");
  58:	e51b3014 	ldr	r3, [fp, #-20]	; 0xffffffec  some_memory
  5c:	e59f2044 	ldr	r2, [pc, #68]	; a8 <main+0xa8>    parameter
  60:	e1a00003 	mov	r0, r3          ; r0 = some_memory
  64:	e1a01002 	mov	r1, r2          ; r1 = parameter
  68:	e3a0300c 	mov	r3, #12         ; r3 = 12
  6c:	e1a02003 	mov	r2, r3          ; r2 = 12
  70:	ebfffffe 	bl	0 <memcpy>
  int size_to_allocate = ONE_K;
  int megs_obtained = 0;
  int ks_obtained = 0;

  while (1) {
    for (ks_obtained = 0; ks_obtained < 1024; ks_obtained++) {
  74:	e51b300c 	ldr	r3, [fp, #-12] ; ks_obtained
  78:	e2833001 	add	r3, r3, #1
  7c:	e50b300c 	str	r3, [fp, #-12]
  80:	e51b300c 	ldr	r3, [fp, #-12]
  84:	e3530b01 	cmp	r3, #1024	; 0x400
  88:	baffffe8 	blt	30 <main+0x30>
      if (some_memory == NULL)
	exit(EXIT_FAILURE);
      sprintf(some_memory, "hello world");
    }

    megs_obtained++;
  8c:	e51b3008 	ldr	r3, [fp, #-8]
  90:	e2833001 	add	r3, r3, #1
  94:	e50b3008 	str	r3, [fp, #-8]
    printf("Now allocated %d Megabytes\n", megs_obtained);
  98:	e51b1008 	ldr	r1, [fp, #-8]
  9c:	e59f0008 	ldr	r0, [pc, #8]	; ac <main+0xac>
  a0:	ebfffffe 	bl	0 <printf>
  }
  a4:	eaffffde 	b	24 <main+0x24>
  a8:	00000000 	.word	0x00000000
  ac:	0000000c 	.word	0x0000000c
